home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Animation How-To
/
Animation How-to CD.iso
/
PLY
/
CHAPTER5
/
TUG
/
TUGN.BAS
< prev
next >
Wrap
BASIC Source File
|
1994-01-01
|
3KB
|
104 lines
OPEN "tugn.pi" FOR OUTPUT AS #1
PRINT #1, "start_frame 0"
PRINT #1, "end_frame 35"
PRINT #1, "total_frames 36"
PRINT #1,
PRINT #1, "outfile "; CHR$(34); "tug"; CHR$(34)
PRINT #1,
PRINT #1, "include "; CHR$(34); "\ply\colors.inc"; CHR$(34)
PRINT #1,
PRINT #1, "viewpoint {"
PRINT #1, " from <10,10,-15>"
PRINT #1, " at <2.5,2.5,2.5>"
PRINT #1, " up <0,1,0>"
PRINT #1, " angle 30"
PRINT #1, " resolution 160,100"
PRINT #1, " aspect 1.43"
PRINT #1, " }"
PRINT #1, "background SkyBlue"
PRINT #1,
PRINT #1, "define pi 3.14159"
PRINT #1, "define angle_nor frame*2*pi/total_frames"
PRINT #1,
PRINT #1, "define ph1 0*pi/3"
PRINT #1, "define ph2 2*pi/3"
PRINT #1, "define ph3 4*pi/3"
PRINT #1,
PRINT #1, "// little orbital repellers"
PRINT #1,
PRINT #1, "define fx1 2.5 + 5 * COS(angle_nor+ph1)"
PRINT #1, "define fy1 2.5 + 5 * SIN(angle_nor+ph1)"
PRINT #1, "define fz1 2.5"
PRINT #1,
PRINT #1, "define fx2 2.5 + 5 * COS(angle_nor+ph2)"
PRINT #1, "define fy2 2.5"
PRINT #1, "define fz2 2.5 + 5 * SIN(angle_nor+ph2)"
PRINT #1,
PRINT #1, "define fx3 2.5"
PRINT #1, "define fy3 2.5 + 5 * COS(angle_nor+ph3)"
PRINT #1, "define fz3 2.5 + 5 * SIN(angle_nor+ph3)"
PRINT #1,
PRINT #1, "define fx4 0"
PRINT #1, "define fy4 0"
PRINT #1, "define fz4 0"
PRINT #1,
PRINT #1, "define f 1"
PRINT #1, "define p 2"
PRINT #1,
PRINT #1, "object { "
PRINT #1, " sphere <fx1,fy1,fz1>,0.2"
PRINT #1, " shading_flags 32 + 8 + 4 + 2 +1"
PRINT #1, " shiny_yellow"
PRINT #1, "}"
PRINT #1,
PRINT #1, "object { "
PRINT #1, " sphere <fx2,fy2,fz2>,0.2"
PRINT #1, " shading_flags 32 + 8 + 4 + 2 +1"
PRINT #1, " shiny_blue"
PRINT #1, "}"
PRINT #1,
PRINT #1, "object { "
PRINT #1, " sphere <fx3,fy3,fz3>,0.2"
PRINT #1, " shading_flags 32 + 8 + 4 + 2 +1"
PRINT #1, " shiny_red"
PRINT #1, "}"
PRINT #1,
PRINT #1, "light <0.8,0.8,0>, <fx1,fy1,fz1>"
PRINT #1, "light <0,0,0.8>, <fx2,fy2,fz2>"
PRINT #1, "light <0.8,0,0>, <fx3,fy3,fz3>"
PRINT #1,
PRINT #1, "light white*0.5, <9,15,-10>"
PRINT #1,
PRINT #1, "///////////////////////MAIN LOOP/////////////////////////////"
PRINT #1,
FOR a = 0 TO 5
FOR b = 0 TO 5
FOR c = 0 TO 5
a$ = RIGHT$("00" + LTRIM$(STR$(a)), 2)
b$ = RIGHT$("00" + LTRIM$(STR$(b)), 2)
c$ = RIGHT$("00" + LTRIM$(STR$(c)), 2)
x$ = "x" + a$ + b$ + c$
y$ = "y" + a$ + b$ + c$
z$ = "z" + a$ + b$ + c$
PRINT #1, "define a "; a$
PRINT #1, "define b "; b$
PRINT #1, "define c "; c$
PRINT #1,
PRINT #1, "include "; CHR$(34); "tug.inc"; CHR$(34)
PRINT #1,
PRINT #1, "define "; x$; " a + f1 * drx1 + f2 * drx2 + f3 * drx3"
PRINT #1, "define "; y$; " b + f1 * dry1 + f2 * dry2 + f3 * dry3"
PRINT #1, "define "; z$; " c + f1 * drz1 + f2 * drz2 + f3 * drz3"
PRINT #1,
PRINT #1, USING "object { sphere <\ \,\ \,\ \>,0.2+f1+f2+f3 reflective__white }"; x$; y$; z$
NEXT c
NEXT b
NEXT a
CLOSE #1